package com.example.administrator.kotlintutorial

/**
 * Created by chensuilun on 2019/3/7.
 */

fun main() {
    for (i: Int in 0..10 step 2) {
        println(i)
    }
    println("==============")
    for (i: Int in 10 downTo 1) {
        println(i)
    }
    println("==============")
    var list = arrayListOf<String>("a", "bc", "def", "ghij")
    for (s: String in list) {
        println(s)
    }
    println("==============")
    for ((index, str) in list.withIndex()) {
        println(str)
    }
    println("==============")
    repeat(10) {
        println(it)
    }

}